﻿using System.Windows.Media.Media3D;

namespace Wen.UI.NavigationElements
{
	internal class DirectionalLightDirectionViewModel : XyzControlViewModelBase
	{
		private readonly Vector3D _stockDirection;
		private readonly DirectionalLight _directionalLight;

		internal DirectionalLightDirectionViewModel(DirectionalLight directionalLight) {
			_stockDirection = directionalLight.Direction;
			_directionalLight = directionalLight;
		}

		protected override void ApplyXMovement(double step) {
			_directionalLight.Direction += new Vector3D(step, 0, 0);
		}

		protected override void ApplyYMovement(double step) {
			_directionalLight.Direction += new Vector3D(0, step, 0);
		}

		protected override void ApplyZMovement(double step) {
			_directionalLight.Direction += new Vector3D(0, 0, step);
		}

		protected override void Reset() {
			_directionalLight.Direction = _stockDirection;
		}

		protected override Point3D RawCoords {
			get { return new Point3D(_directionalLight.Direction.X, _directionalLight.Direction.Y, _directionalLight.Direction.Z); }
		}
	}
}
